<!--
  @author:  gbq
  @date:    2024/6/21
  @file:    客户联系人
  @require:
-->
<template>
  <div>
    <div class="flex items-center justify-between">
      <!--      <div class="text-gray-600 text-sm">-->
      <!--        <i class="i-bi-bookmarks-fill"></i>-->
      <!--        联系人-->
      <!--      </div>-->
      <TitleName
        icon="i-carbon-bookmark-filled"
        title="旧ERP历史订单"
      ></TitleName>
    </div>
    <el-table
      ref="multipleTableRef"
      :data="tableData"
      class="mt-2"
      style="width: 100%"
    >
      <!--      <el-table-column-->
      <!--        :selectable="selectable"-->
      <!--        align="center"-->
      <!--        header-align="center"-->
      <!--        type="selection"-->
      <!--        width="55"-->
      <!--      />-->
      <el-table-column
        align="center"
        header-align="center"
        label="订单编号"
        prop="cbillcode"
      >
      </el-table-column>

      <el-table-column
        align="center"
        header-align="center"
        label="物料名称"
        prop="cmatname"
      />
      <el-table-column
        align="center"
        header-align="center"
        label="订单时间"
        prop="ddate"
      >
      </el-table-column>
      <el-table-column
        align="center"
        header-align="center"
        label="总金额"
        prop="itotal"
      >
      </el-table-column>
      <el-table-column
        align="center"
        header-align="center"
        label="数量"
        prop="iqty"
      >
      </el-table-column>
      <el-table-column
        align="center"
        header-align="center"
        label="状态"
        prop="status"
      />
      <el-table-column
        align="center"
        header-align="center"
        label="创建人"
        prop="ccreatorname"
      />
      <el-table-column
        align="center"
        header-align="center"
        label="所属单位"
        prop="orgName"
      />
    </el-table>
    <pagination
      v-show="total > 0"
      v-model:limit="queryParams.pageSize"
      v-model:page="queryParams.pageNum"
      :total="total"
      @pagination="getList"
    />
  </div>
</template>

<script name="CustomerContact" setup>
import { getCurrentInstance } from 'vue'
import {
  getDetailTactlist,
  updateForMainContact
} from '@/api/customerManage/customerList'
import { erpOlderporder } from '@/api/salesManage/businessManage/index'
const router = useRouter()

const { proxy } = getCurrentInstance()
const props = defineProps({
  tableParam: {
    type: Object
  }
})
const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10
  },
  tableData: [],
  total: 0,
  selectionData: []
})
const { queryParams, tableData, total, selectionData } = toRefs(data)

/**
 * 获取列表数据
 */
function getList() {
  queryParams.value = { ...queryParams.value, ...props.tableParam }
  erpOlderporder(queryParams.value).then(res => {
    tableData.value = res.rows
    total.value = res.total
  })
}

getList()
/**
 * 表格多选
 */
function handleSelectionChange(data) {
  selectionData.value = data
  console.info(selectionData.value)
}
</script>

<style lang="scss" scoped></style>
